Started to code the legal moves function.