Generalized difference method