solved problems 1 & 2