added program mode selection