turned into a total rewrite again, approaching stability