for second version - generates chart