working html/jinja for PD condition. Python not yet implemented.