solved problems 12 and 13