updated graph scripts to work with current db structure