refactored longest_run for dashboard