Added some data munging code