Added a function that checks if its possible for the piece to move from a to b