fixed some bugs in isValidMove but still seems to have some problems with step moves