completely rewrite