function for debugging