Added debugging function