added clock object and refactored affected systems to use it