Finding dimensions of a shape