added state management and history functionality