replace int[] with Long in transposition to save memory