settlement issues fixed, unit testing for payout implemented