Added cell version of function algorithm