finsih map generator but has a bug