inplemented waitpid. btw. fork has some issues which should be fixed