rewrite halfway done