solves problem 13