initial version
added validate method to check which flags are valid