cleaning up and getting ready for R/Java retrieval and comparison