refactored bin/test_gem, all tests passing