Implemented If, Else, EndIf logic