add flags functionality