fixed the difficulty computation