optimizing panel positioning