Restored test header, changed some for's to foreach's.