Not sure what's up with the spacing here and in some other places. It seems that it's two-line indentation, but for repeated lines you use 4 and then continue the next if statement on the next line with the same indentation? It doesn't make sense to me.