This should give you an idea. You should consider a FSM.

6684324-340HeatRiserInstallation.jpg