converted to ruby