Corrected gem removal

Was previously matching x of ledge, so was following ledge even after
begin positioned off side of game.

Some unused variables removed.