Fix long times, use dicts for codes