add Flags.java
delete commented code
refactor Flags, use int for each flag