 							_tmp_bitmask := (lpad('',_end_bitmask_date - _end_date,'0'))::bit varying;
 							_new_bit_mask_trimed := _new_bit_mask_trimed || _tmp_bitmask;	
 						END IF;						
-						RAISE WARNING '_new_bit_mask_trimed : "%"  _previous_bit_mask_trimed: "%", _start_bitmask_date = % _end_bitmask_date = %',_new_bit_mask_trimed,_previous_bit_mask_trimed, _start_bitmask_date,_end_bitmask_date;		
+						-- RAISE DEBUG '_new_bit_mask_trimed : "%"  _previous_bit_mask_trimed: "%", _start_bitmask_date = % _end_bitmask_date = %',_new_bit_mask_trimed,_previous_bit_mask_trimed, _start_bitmask_date,_end_bitmask_date;		
 						select applybitmask(_previous_bit_mask_trimed, _new_bit_mask_trimed, _start_bitmask_date, _end_bitmask_date, _operator) INTO _tmp_bitmask;
 						select * FROM detectmaskbounds(_tmp_bitmask, _start_bitmask_date, ((_end_bitmask_date - _start_bitmask_date) + 1)::smallint) into _computed_date_pair;
 					END IF;

		_bit_mask_text text;
		_segment_bit_mask text;	
	BEGIN
		RAISE WARNING 'detectmaskbounds : _tmp_bitmask % _start_bitmask_date % _bit_mask_lenght %',_tmp_bitmask, _start_bitmask_date, _bit_mask_lenght;
		_iterator := 0;
		_first_active_bit_index := -1;
		_last_active_bit_index := 0;

					END IF;
				END IF;
				_cal_elt_number := _cal_elt_number + 1;
				-- RAISE DEBUG 'Computed = (%,%) : % (%)',_computed_date_pair.start_date,_computed_date_pair.end_date,_computed_date_pair.bit_mask,_computed_date_pair.mask_length;
			END LOOP;
			-- If we are on first recursion level, there is no cal_elt record with the provided rank (the one all that stuff must add)
			-- But we need to take it into account for finish computation
			IF NOT _cal_elt_rank_found AND NOT _currentElementDeletion THEN
				-- RAISE DEBUG 'Calendar element of rank % not found in calendar % (_cal_elt_number = %)', _rank, _calendar_id, _cal_elt_number;
				-- If _rank is null, current calendar element is being deleted.
				-- In that case the calculation (of the current calendar) is simply finished
				IF _rank IS NOT NULL THEN
					IF _cal_elt_number = 0 THEN
						-- RAISE DEBUG 'First calendar element ! We set date to (%, %)', _start_date, _end_date;
						IF _operator != '+'::calendar_operator THEN
							RAISE EXCEPTION 'First calendar_element must always have an operator + ';
						END IF;
