fixed headers problem and added variables to read data