cleaned up, added comments, and fully implemented set_tracer and unset_tracer which where missing boolean checks