refactoring... rewrote Map