code example adjusted