Added getPredecessors function to state.py