added switch to header code