added flag and comments