corrected self to be class
added solutions for problem 4