Modified math to correctly retrieve window size

Different method to retrieve width (most importantly, no scrollbars)