How could I make this code better?

Thank you for clearing that up for me @derekprior