I think the 0 in DIM should be [0] not (0). Other than that, it's fine, but it's a little different from what I do, so you might have to tinker a little.