Changed method of obtaining screen size