migrate setup code back again for realistic test
sort
work on test
fix StackOverflowError caused by copy/replace