Got a event based version working well. Just need to clean things up now