Conditionals Wacky

code was tidied up to make things easier to read