fix the sizing function