V3 update

Modifications and corrections to code made.