updated GetBlocks function
merged  colour detection stuff