Here it says an int is returned, but what you really mean is a state.
See here to implement that: http://www.enel.ucalgary.ca/People/Norman/enel315_winter1997/enum_types/