Use reduce-kg in transform
Fixed indentation for readability