corrections from stackoverflow