Restructured all the code, learning more about Xlib