Updated documentation; modified some functions