added tests, scope guard, top-level include