adding code for separate functions to read server and client key to load and adding client/server mode ; formatting the code, functions and if statements