model sizing algorithm bugfix