calculate state delta