Added more support for ios 5 rotation and fixed the histogram loading problem. Also added an attempt to rotate to current orientation