minor fixes
Refactoring
testing scripts heavily refactored-> suprising (bad) results