Improvement on mapgeneration