Added most of the stuff. Doesn't work yet. :-)