C client (need some improvements though)