fixed line based diff & added some tests