Introduced use of data.table(). Increased speed.