Ruby optimisation challenge for @chchruby