Updated Algo for difficulty changes