added dimension handling