changed detecotr to Detector and fixed import
removed float assertion to prevent 0 from raising an error
isolated the leak