calculating several states in advance