added debugging and additional tools