First internal implementation using dictionary