Added iterative way of counting list