add prototype and use 'char' instead of 'unsigned char'
Remove unused variables
add prototype