substring finding
matrix multiply