Refactored update(). JOIN, ENTER, and EXIT function