Added 'pairs' and adapted lval/rval-steps from previous code. Added test for both.