converted the rest of ScriptConverter to swift