Preserving all carbs' previous work

unforking from Zaiming’s code