added code to check when row matches initial startIndex and then only go left