slight refactor in euler.rb