Finished implementing the clietn code