Merged John's changes with mine
Integrated John's changes into the test