added removeunchangedfields function