timing done for problem 5