solved problem 3, closes #1