Fix Spear calculation error and refactoring