now it correctly calcs the values when processes are exiting; there is a lot of commenting code in an attempt to find a method of taking into account the exited childs resources too - commented because there is success yet