added if else statements/ also comments on each if else statement