edited function return