Some semblance now.

1. Some coding and quite a bit of debuggin still remains.