Made coordinator smarter

This is a replacement for #16