Hello all! I have been working on a puzzle game called pecs were you try to eliminate like pieces by pushing them together but I have a problem sometimes when you push two pieces together from up to down you get a ghost piece which behaves quite strangely and I have spent the last 5 hours trying to solve it. Because of the very complex GUI I made to make the game look nice the code is quite long and has many files. This being said I must post this as a file instead of past bin :(/>((. Sorry for all the trouble I have caused :(/> but I am quite stuck.
Here is the code.

On a side note how do you like the GUI and gameplay?