Moved query's so they can only be read when program starts up, added map query