refactoring 'fixpoint' and other code for display in paper