Updated Code