Upgraded code from 3.02 to 3.7