More flow logic written