Replaced count of 2^n with simple linear