Added ClientData, cleaned main a little.