minor revisions and beginning of client code