added in FindAvaibleIndices() method and some other stuff.