re-writing pattern library