gets graph working by getting same number of elements