WIP
cleaned up the test code, seems to be working