fixed up how to convert data into storage format.