added custom errors and cleaned up docs