Better dim handling

Now dim values dont overwrite each others