Added the proper client code. Will add some explainations later on.