Changed code to read t_max from the header