split the partitioning function off parse_niko into its own script