massive updates, many error fixes,  around 10 new functions