gutted some code