my template is horrifying but this 'works' currently