Completely rewrote the loading block. Added xml