Refactoring code
Enhance Output and Algoritm