added if-endif for display stmts