changed diagram creation