Made A few changes to the Update Function