cleaned up update amounts code.