change calcuration of num_of_panes