Update

Improvements on the code