Refactored Map, should work better now