gets the flags right