Rewrote getavailmoves. Not working yet