updated code jan 22 2014