replaced Java version with Ruby version