finished header logic