updated files from email on Aug 16, update curVal and training functions