Implementing the algorithms in Timo Bingmann's video.