combining cleanup
no malloc