Used a different approach for Ruby example to improve output