Adding Time library and a few code updates