Added goal test function in state.cpp