incorrect increment code corrected