neatened things
refactored and added sample server and client