adding solutions up to problem 8