re-write rules