changed back to Ruby 2.0 compatibility, added unit-test