Modified Code: