Detail page with comparison test

Shifted other variables into scope