added if else statements