map fixed

fixed error that prevented map from loading, and cleaned up code