made several changes to conditional statement

made several changes to conditional statement still not working properly