chars -> unsigned chars, remove unused variables