Added a new function getdifficulty()