Using convert.pamguard() to tidy up code.