implemented and fully tested the pay-off functionality