The results of my procrastination, works much nicer, but hasn't been tested through an event.

Use previous revision if any major bugs pop up