Rewrite modify_s list comprehension