improving error handling; adding docs