Added population query, and process.exit on done