Fixed using Array.map where I should be using Array.filter (chat code)