fully rewrited