memory leak fixes, hflip, vflip, dflip, comments