Wrote some array functions