Fixed data type errors and added ApplyMove()