more or less finalized main method in Query class, possible to test with proper menu now