cleaned-up legend and added some interaction