I am going to list the code first and explanation later.

I have this HTML-Code

HTML Code:
    <div class="develop-bl">   <i></i>          
      <ul>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>						                      
        <li>                     
        <a href="#">entry</a>                     
        </li>	     
      </ul>	     
    </div>
and this Javascript-Code

Code:
    var y = $ ('.develop-bl').find('li').length;
    	if(y%4>=0) {
    		$('.develop-bl li:nth-child(4n+4)').css('margin-right','0px');}
    	if(y%4==0) {
    		$('.develop-bl li').slice(-4).css('border-bottom','none');}
    	else {
    		var y = $('.develop-bl').find('li').length;
    		var b = y/4;
    		var values = b.toString().split('.');
    		var v2 = parseFloat(values[1]);
    			if(values[1]==5) {
    				$('.develop-bl li').slice(-2).css('border-bottom','none');}
    			else{
    			var i = values[1]*0.04;
    				$('.develop-bl li').slice(-i).css('border-bottom','none');}						
    	};
The goal is to have 4 li-entries each row, which this code accomplishes. What needs to be changed to have 3 or 2 entries each row?