Added input validation to all public methods