finished up flag convesion