Rewrite of the whole system