fixes, clean, extensive testing