complete logic and supply a simple menu for operating.