added comments and corrected increment according to number of lanes