basic graph preparation