many bugfixes! and updating examples