Created a getState method for all the objects