Final version with support for negative char values