trying to improve legend