Adding getBlock() function