clean up the code implementing reads of irregular data into R