Added step method to iterator, and modified math.median computation