power of two algorithm was added