fixed some bugs in isValid. also i feel like somethings wrong with minimax since the small evaluation function i wrote keeps losing.