Added refdata
Read data from file
Some changes