Rewrote some parts of the tile highlighting (fix #1)