Rewrite

Full rewrite of the module