major rewrite, still uncertain