rewrite and new features