code clean up for spider graph