fix format and add sample for 'from accumulate' and 'from collect'