also update on the working code