First version, almost done.