Refactored the code to have a function to create each blocks
Recatored Block creation into a Class BlockNode
Remove blocks with same color in just above and beside range of selected block