Implemented all functionality. Map state is saved and restored.