updated doc, used execeptions instead of return values