Cleaned up occupancy code