Implement header scan. buggy.