Removed use of ddply.