updated with the second answer
cleaning up other test code