many changes to data structures and test functions