Fixed problem with strict mode

xPos/yPos both as a variable name and function name led to errors in strict mode