[12]Implemented more efficient factor-finding algorithm