If then else statement working. Still need to test code.