updted diagram