organise graph output