fully implemented debug