Here you need to set negative values to zero (otherwise, the tree cannot grow at all, which is probably not intended). Or use 'unsigned int'.