hakcing, modifying function to be useful with plyr

not working, committing while I change places