modified insertNewNode() method so that the element will be inserted in order.