Added debugging features to bad trials script