cleaned up code a bit and removed print statement from ct.stop method