map is now written to file and then read on the nxt
fixing small errors and cleaning code