Updated 3.1 substantially
Merged