Fixed index out of range error
The port must use >= during comparision