Updated header

Now correctly writes the header information