Updated code to use new grasshopper patterns.