implemented diff procedure