Add back more code that was deleted