accommodate input dimensions not in form of 2^n