moved test code to file, cleaned up a bit