fixed diffing, added templates