add the solution for the first 3 questions