some tests
tests for derr
minor clearing
minor clearing
minor refactoring
find bug with Functions