Code clean up. Add resize, destroy function.