solution for s1
solution to s2