I need to optimize the following code. Tried using FOR, but the image shows all at once.

Used the following solution, but this not optimized.

```
$(document).ready(function(){

function fadeInOut () {

     var $element1 = $('a#imagem01');
     var $element2 = $('a#imagem02');
     var $element3 = $('a#imagem03');
     var $element4 = $('a#imagem04');
     var $element5 = $('a#imagem05');
     var $element6 = $('a#imagem06');

     $element1.fadeIn(2000, function () {
     $element1.fadeOut(2000, function () {

     $element2.fadeIn(2000, function () {
     $element2.fadeOut(2000, function () {

     $element3.fadeIn(2000, function () {
     $element3.fadeOut(2000, function () {

     $element4.fadeIn(2000, function () {
     $element4.fadeOut(2000, function () {

     $element5.fadeIn(2000, function () {
     $element5.fadeOut(2000, function () {

     $element6.fadeIn(2000, function () {
     $element6.fadeOut(2000, function () {

     fadeInOut();  

     });});});});});});});});});});});});

     }

     fadeInOut();

});

```

I need Help Please!