private int findPosition(LinkedList list, long startTime)
    {
        int index = 0;

        // if the waiting list is empty, then add to it straightaway
        if (list.size() == 0) {
            return index;
        }

        Iterator it = list.iterator();
        ResGridlet rgl = null;

        // iterates a loop to find the location based on start time
        while ( it.hasNext() )
        {
            rgl = (ResGridlet) it.next();

            // exit the loop if object's reservation start time is greater
            if (rgl.getStartTime() > startTime) {
                break;
            }

            index++;
        }

        // if append at the end of the list
        if ( index > list.size() ) {
            index = list.size();
        }

        return index;
    }