saving every density value, change the way processes are joined
correctly terminating the processes and lessening number of spawned jobs