make problem 14 faster