First _seemingly working_ implementation (tests, demo and optimizations will follow)