started fleshing out client handling