implement getState() using a State class... pretty sure it works at the moment