almost finished debugging check