implemented debugging