lots of nice fixes in here, thanks!

could you also unfuck the indentation? pick either 4 spaces or hard tabs and apply it to the whole file