Changed to SHA1 andded new hopefully better reduction function