Solved problems 2 & 3