add cprintf function for debugging