Modified legend and maybe fixed some things?