removes extraneous array values