added getwidth method