Add debugging function