add function to get dimension