functions to get width and height of window