modified for debugging