Added flow-applying function