Power calc copied from MusicalSquares