started improving the code for the height and width