migrated function examples to gist