fixed bugs and added X11 mouse control (not yet working