use printwriter insted of bufferedwriter. fix indent. add connected message. remove unnecessary methods/vars