I think I might have persuaded smarty to do what I want here