update all code for working version