add some function for map generating. Not complete.