problem4 solved and updated the time measurement