Completed resizable map and refactored code