Updated dimension function.