cleaned up treegen code