main function (sans series stuff) complete