major rewrites