Added for detecting screen information.
Separated operations. Could support starting game by press a key.
Code clean up.