Changed the loop structure of the execution

* Removed the nested while which just checked for true condition
* Modified the loop control mechanism
* Now it enters second loop if and only if there are jobs
Changed time