cleaned up random_move code with macro