Commented useless parts, hide the loader just before the map, re indented the code and added comments