final update of code