upated code