made appropriate methods throw acceptions
added function numbers in comments