Recoded and Only 1 bug left for the test!