refactoring graph
bug fix in sp500