added debug statements, dynamic allocation is working for tasks