events working... need testing and some refactor