Removed some for loops over dimensions