Adjust for layout and fix for calculus of qq