Final version of all algorithms and added Pollard's P-1 method.