Added memory usaage restrictions.. not done properly, need to use resource utilization stats for accurate funcitoning