initial commit with the codez. Fairly complete, hardly tested.