added a nonzero method to state