added scan for non power of 2 arr