finishes rewrite of bucket