added in state validation, untested, will by 12/3/2013 ~6pm