Rewrite to make work with ST3