Complete rewrite, and another set of libraries used.