Fix hex in all cases
Initial payout code with tests