adds basic formula logic for debt calculation