Replaced local use of  with which()