Added if else. Changed else

Made additions and changes to the code to allow for three conditions.