Use tabs, generally speaking (each time you go in a level, another tab is necessary).
Keep your functions declared at the top, then variables declared, then connections, then loops, or some order that you like is also best.
Something to help clean up code is separating functions and things by 2 lines, but otherwise there is only ever one blank line in the code. |