repos some things, using global pos var, fix syntax error