getting close to finishing ....
all of this yet to be debugged.