tidying graph builder