Fix some minor issues, make some code prettier. Add a bit more explanation on some things.