updated refund logic. all tests pass