fixed up the naming of flags and fixed a bug