Added scalar graph, simplified class structure.