Fixed bug in get_diff() fucntion where iterator was iterating at wrong steps