printing function and debug