stubbed out validPrefix and indexOfSubstring functions