Code updated with statistics