program to insert element into an array