What variable controls where the circle is shown? Where is the value of the variable changed?
Try debugging your code by adding print outs to show the value of the variable every time it is changed...