Adding numPanels option, some cleanup