Emil's Flagmatic 2.0 with minor modifications for installation (functionality untouched)