added task function and moved schedule info to map
updated to use global map
first fit priority queue management