Define transition as struct.
Apply for_each algorithm