Updated code from Blocks to Craft.