continue rewrite -- work in progress