now calculates time and best solution; save on file