first version with editable graph (maybe there are some bugs... see later...)