changed constants to flags