add a solution to the first problem of exam2