added missing throws clauses to functions, for neatness