+ removed extra debug code
* final fixes and cleanups
* this works very well and will be merged back into master