simplified debug output function and renamed it according to functionality