An updated version with GUI