Function to create dictionary from blocks