resoluted problem 10
improved performance using ruby's library, cheating?