Added function for C