Implement `when'