fixed memory errors, naming issue in coo rewrite