finished a big chunk of the trails rewrite