Initial conversion to ruby