Adding solutions for problems 7,8