use  function since we are working with an array now