If x < w2 Then x = w2 ElseIf x > screenwidth - w2 Then x = screenwidth - w2
Woah! The above used to be quite dangerous...
A bug in older versions meant 'ElseIf' could be used in place of 'If' in some cases. Therefore, the above actually meant:
If x < w2 Then x = w2 If x > screenwidth - w2 Then x = screenwidth - w2
No biggy in this case, but could have had serious implication in others.