Added necessary header files; Added comments; Fixed void pointer