corrected mistakes and added inital flow