added garbage collection and time formatting