Trees + some arrays problems