an effort at fixing panorama, not sure if it's correct thoguh. Pleast test.