Merged the 2 solutions in one solution