You might have something like this for your code. You have comments, but it’s still kinda messy. Adding more comments might help, but to a point, it makes your code too long. (I can actually do with adding just a few more comments)
To fix this, you can use curly brackets to shrink your code. The updating section shows you how it’s done. The small arrows next to the line number open and close the code.
Just a little quick and easy way to clean up your code.