Add a form of when that takes an array