added documentation & fixes