Update Function

Imporove some functions