solving problems 3,4