Compressed time functions into one. Fixing unit tests...