check the difficulty function