Added calculation of dimension. Added speed.