modified test based on Kurt's code (so DEBUG is no longer needed)