Added average option
added lmng
adp for newton