data handling

need to further debug to clean up on data processing