modified to use dimensions function from param_spec
modified to use dimensions function from param_spec refactoring