added spacial dependence on users, changes made in analyze.cpp and state.h