corrected functions