almost complete adding payment functions