produces expected output