rewrite

Lot of fixes, improvements, ..