Implemented most of the legal move generation