Adding getBlock function