fixed bug in example 6