Exercise23 modified