add top_loan function