updated the JavaDoc, added some exception throwing