added a solution to problem 3 and some alternatives for problem 8