Updated person 3 code to not modify original array