Code prettifying and more explanation