Updated getIndicesOf() for more effeciency, refactored variable names, and better comments.