tons of changes

converting from python to ruby