fixed if statement creating undefined answers