corrected according to the comments