libavoid taken from adaptagrams