problem 10, coffeescript -- very slow