Replace $judgeroot variable with call to sub

This was messy.