Implementation for algorithms introduced on http://decomplexify.blogspot.com/