don't check POLLOUT if buffer is empty
rewrite first addition
collisions work
free memory
fixed other bugs