added check to ensure cmd line arg in range, turned if/else chain into switch statement
added functionality for secondary database