Function to move tasks between headers