One confusing thing I see in the code is that there are more than one statement on a line. That makes it harder to read and understand the code. There should only be one statement on a line.

You...