Original Rubyesque version