migrated to std::map - not thoroughly tested yet