New and improved implementation.
Started implementing interface, proposed by D. Safonov.