basic difficulty calculation and re-added local database option for ease of testing