solutions to problems 1-5