calculate owed as subquery here too