all
some cleanup. started adding state/residual mapping