code: function findNextM(arr, offset){
  
    if(offset === false) return false
  
    for(var i = offset, len = arr.length;i < len;++i){
  
      if(arr[i][0] == 'M') return i
  
    }
  
    return false
  }
docs: finds the next position of type M