Added solution for flags