Fixed a lot.

Software now also works with random dots.