Changed format and comments for #4 and #5 to make sure print mean and median, added #6 wait() to make the parent wait until child has finished