added extra solutions for problems 5 and 6