Almost done converting to Ruby