Final Version

Everything works, 10/10 test cases check.