Added autofit method