added implementation of diff1