actually parse flags