Updated jsfiddle to mirror template functionality