Used defined flags macros. (and fixed indentation)