modeling objects with state