sadly it can be jagged. this function will be updated/eliminated in favor of scipy's function after this pr.