General formatting and some comments

I hope I didn't break anything