Added legend
TODO : fix tests