handles ack and works but not optimized