sending data moved out of calculate_next_move function