Fine-tuned test.cpp