extracting the GEM and fixing some paths
extracting the GEM and fixing some paths