Updated Code. New changes