updating and cleaning  up