added flag and flag_weights modules