Im not sure about ur second question.
I was just pointing out that you need to understand the events I added (that check X and Y) to fully solve your problem. Take some time to experiment with the tutorials and read the wiki. If you get stuck down the road then I'm sure someone here will be happy to help!