Added a bunch of test code