Part one of the code I use to load maps