added a addJobsToHeaps method