Rebase sg

Can't we make this with list comprehensions?