Handle difficulty calculation