completed code for Shatra original version, added startup dialog box to choose