Implemented solutions for problems 7-17