added logging and a sample client