some minor changes to flow