added flags + functionality