Many improvements on map code. Still working