added available-moves function and fixed draw function