Cleaned graphs code, removed unused variables and code