Updated to in-progress rewrite