added flags, minor changes