Insert element into sorted list

Given a sorted list with an unsorted number V in the right-most cell, this code is to insert V into the array so it remains sorted