Changed the structure of the header, gives correct output now.