made screen_width and screen_height global
fixed bugs, added control struct