Added debug prints and context managers