added clear button and loan functionality