make sure you check the length. u might have to reallocate a new array if the length is too short