increasing prog children limit, need to remove eventually
added 'remainder' function