Beginning of implementation. Began with data structues. Code snippets
are at ideas file. Will be moved to approriate place later.