Revisions and serious debugging
Some long overdue debugging