Implemented a function to obtain a screen width