rewrite spec file
refactor appropriate_e_recursion, clean up code