payment histories calculation