working version of TaskManager. need to add more error/argument checking