Cleaned up and commented map.js