Added last node template code