added main script and client termination :)