added some framework for autodimensioning