PatternMatch now returns list of indexes in correct order