Modify the function insrt above such that if the position parameter specified by the user is less than 1, the new value will be inserted in the first position of the vector; if the position parameter is beyond the last position of the existing vector, the function will insert the new element in the last position.