Updated

Improve the code