Fixed difficulty calculation, switched to integer only math