add function of lastmove