added notification for password not found and terminate all processes
split into masters and workers
removed redundant declaration
moved totalProcesses check
added comments