More concise
Move comment outside function
Map layers now properly displayed in map window, many other fixes and refactors