added flags, other changes