reformat code
implement loan calculating algorithm
refactoring: remove duplicating code
added index page js validation