Created a macro to help shorten and clarify code in the main loop