joined code with spencer