a lot of clean up including a proposed macro to make control flow very easy.