complete spec and solution for problem 3