Adds flags functionality