added some plyr functions