Best way to optimize code as well as reduce amount of code you have to write: use math.
ex.:


These if/else statements are completely unnecessary, and quite frankly make your code difficult to...