UPDATED: permute and reverse permute now work for all int, float, and complex data types