Fosued on reshape/plyr rather than R-base functions