Ruby Implementation