Added second implementation with more ruby-flavor.