changed debug function to public