fix test for singletons file
add seqnum to singletons filename
code clean up; add comments about data structures used