Completed basic code for building trees for blocks.