Updated functions --David Caratelli