Refined the code

Refined code and line numbers reduced