adds a simple test script, and fixes a bug