implement new move algorithm