reformat code because it was ugly