new changes for HTML plotting