fixed pointer bugs
added modularization to client.c