locals needs to be an instance variable