Further work on model.

Also got rid of a lot of commented VB code.