finished problem 2 and bonus