Still filling in the stubs - added a function to write out the map