add unique flags and some new fields