removing unused functions, adding legend for point chart