Reformatting and commenting a bit in the code