Fixed minor bug. Still need to improve the move algorithm