Working on translating the python to ruby.