Total rewrite, support for ST3