added terminal output for debugging purposes