beginnings of an event system
ms to milliseconds
some optimizations

apparently vector is 7 times faster than a set in this case.