Reworked the conditional statements