algorithm is similar to, and inspired by complexification.net; work in progress