a bit more event logic, probably need to refactor still