update code from 2.0