implemented legend (issue #35)