Fixed problem with strict mode

xPos/yPos as both a variable name and function caused errors.