Added graceful termination condition for all processes (No more sleeps!)