began work on ws_read_* functions