Fixed istop function that was given incorrect results