Initial version, needs lots of work yet.