several minor changes to reorg the code. Added a start button