Changed loop a little