worked a bit on problem 2