reformatted all the code