Should it appear to the court that the lease under which the complainant holds or claims title was illegally made and void, then the court may proceed to have an account stated of the amount of money, principal and interest which has actually been paid in consideration for such lease by the complainant and those under whom he may claim, and an account of the rents, issues and profits arising from said land, less the cost of any necessary, permanent, valuable, and not ornamental improvements made upon said land, and may decree any excess of money paid and interest and cost of improvements over the rent, issues, and profits to complainants. Such decree shall be a lien upon the rents, issues and profits accrued or to accrue from the particular sixteenth section involved in such suit until the same is fully paid and satisfied. Upon the rendition of such decree, the secretary of the board of education shall issue a warrant for the amount decreed to be paid to the complainant against the funds of such sixteenth section, and the same shall be paid out of the first available money to the credit of such funds. Any excess in the amount of the rents, issues and profits, after deducting the cost of improvements and amount paid by complainant, shall be decreed against him, together with a writ of possession in favor of the defendant. All court costs in suits brought shall be paid by the party or parties seeking relief under the provisions hereof.