add 'pair' utility function to simplify broadcasting of k and z to equally sized 1D arrays.