added fprintfs, replaced lws.h