replace S.map() method