Error handling + documentation