need to work on averages using data.table