Added legend (but it needs improvement