finished debugging part