added entitystate struct