added legend and pointer