added ack and some minor cleanup