Split program into logger and query. Need delays to allow commands to complete.