improve 2 solutions