Added Black node and Compacted code