added logic for the retainer, and payments