improved layout of diagram