finished implementing debug