you are right, header length will always be 0 since I moved header outside of the loop in the new code. will update