add plotting, splitn, and fix cmd line parameters