Calculates Pi via iterating algorithms