replaced time array with time object, improved formatting and clarity