update to change lapply to ddply method
remove a couple data caching steps